config(:basic) do
  ftpserver = Platform.config.ftpserver
  # from is a alias of read
  config(:ftp, :title => "FTP设置", :description => "FTPServer作为公共服务，提供传输文件数据的功能", :order => 50) do
    item(:port, :title => "端口", :help => "FTPServer提供给其他组件访问的接口", :validation => "required digits")
    item(:admin_password, :title => "管理员密码", :help => "FTPServer唯一具有管理员权限的密码", :validation => "required alphanumeric")
    #item(:anonymous_password)
  end.from do |cfg|
    ftpserver.reload!
    cfg.port = ftpserver.port
    cfg.admin_password = ftpserver.admin_password
  end.apply do |data|
    ftpserver.port = data.port
    ftpserver.admin_password = data.admin_password
    ftpserver.apply!
  end

end
